package com.alex.interceptors;

import java.util.Map;
import org.apache.kafka.clients.consumer.ConsumerInterceptor;
import org.apache.kafka.clients.consumer.ConsumerRecords;

/**
 * @ClassName UserDefineConsumerInterceptor
 * @Description TODO
 * @Author zjg
 * @Date 2021/12/710:26
 * @Version 2.0
 */

public class UserDefineConsumerInterceptor implements ConsumerInterceptor {

  @Override
  public ConsumerRecords onConsume(ConsumerRecords records) {
    System.out.println(records.toString());
    return records;
  }

  @Override
  public void close() {
    System.out.println("---consumer  close-------");
  }

  @Override
  public void onCommit(Map map) {
    System.out.println("---consumer  onCommit-------");

  }

  @Override
  public void configure(Map<String, ?> map) {
    System.out.println("---consumer  configure-------");
  }
}
